Simple Plant Location
milp
Gurobi
AMPL
short
A simple plant location MIP model
= 0, <=1, integer;
# Assign customer j in M to plant i in N?
var x{N,M} >= 0, <= 1, integer;
minimize Cost:
sum{i in N} f[i] * y[i] + sum{i in N, j in M} c[i,j] * x[i,j];
subject to AssignAllCusts{j in M}:
sum{i in N} x[i,j] = 1;
subject to AssignOnlyIfOpen{i in N}:
sum{j in M} x[i,j] <= m * y[i];
]]>
param n := 5;
param m := 15;
;param f :=
1 101
2 138
3 61
4 132
5 147
;
param c :=
1 1 10
1 2 10
1 3 2
1 4 3
1 5 8
1 6 8
1 7 2
1 8 4
1 9 9
1 10 6
1 11 2
1 12 6
1 13 4
1 14 3
1 15 2
2 1 8
2 2 8
2 3 7
2 4 10
2 5 2
2 6 6
2 7 9
2 8 2
2 9 6
2 10 9
2 11 8
2 12 8
2 13 1
2 14 4
2 15 10
3 1 9
3 2 9
3 3 7
3 4 2
3 5 6
3 6 10
3 7 2
3 8 9
3 9 9
3 10 2
3 11 1
3 12 4
3 13 6
3 14 5
3 15 9
4 1 6
4 2 1
4 3 4
4 4 9
4 5 7
4 6 7
4 7 3
4 8 5
4 9 1
4 10 6
4 11 4
4 12 9
4 13 5
4 14 5
4 15 9
5 1 4
5 2 10
5 3 10
5 4 3
5 5 6
5 6 7
5 7 2
5 8 6
5 9 7
5 10 5
5 11 9
5 12 4
5 13 10
5 14 1
5 15 1
;
solve;
display Cost;
display y;
display x;